package chai.ning.compare.train_13;

import java.util.Arrays;

public class PhoenixTest1 {

	public static void main(String[] args) {

		Phoenix[] phoenix = new Phoenix[5];

		phoenix[0] = new Phoenix("凤凰状元", 15, '男');
		phoenix[1] = new Phoenix("凤凰榜眼", 35, '女');
		phoenix[2] = new Phoenix("凤凰探花", 25, '男');
		phoenix[3] = new Phoenix("凤凰举人", 55, '女');
		phoenix[4] = new Phoenix("凤凰秀才", 45, '男');

		for (int i = 0; i < phoenix.length - 1; i++) {
			for (int j = 0; j < phoenix.length - 1 - i; j++) {
				if (phoenix[j].getAge() > phoenix[j + 1].getAge()) {
					Phoenix temp = phoenix[j];
					phoenix[j] = phoenix[j+1];
					phoenix[j+1] = temp;
				}
			}
		}
		for(int i=0; i<phoenix.length;i++) {
			System.out.println(phoenix[i].toString());
		}
	}

}
